single inheritance program in java